package weaver.jobs.suntai;

import weaver.conn.RecordSet;
import weaver.general.BaseBean;
import weaver.general.Util;
import weaver.interfaces.schedule.BaseCronJob;

import java.util.Calendar;

/**
 * @Title: ecology
 * @Company: 泛微软件
 * @author: weaver.Dusongsong
 * @version: 1.0
 * @CreateDate: 2020-10-30
 * @Description: 每周的资金计划余额清0
 * @ModifyLog:
 **/

public class WeaClearAmountCronJob extends BaseCronJob {
    @Override
    public void execute() {
        BaseBean baseBean = new BaseBean();
        baseBean.writeLog( "-----------WeaClearAmountCronJob------------" );
        RecordSet rs = new RecordSet();
        Calendar cal = Calendar.getInstance();// 当前日期是本月第几周
        int weeks = cal.get(Calendar.WEEK_OF_MONTH);
        rs.executeQuery("select id from uf_zjjh where gxbj=1 and djz=",weeks-1);
        while (rs.next()){
            String id = Util.null2String(rs.getString( "id" ));
            rs.executeUpdate("update uf_zjjh_dt1 set wyje=0 where mainid=",id);
            rs.executeUpdate("update uf_zjjh set gxbj=0 where mainid=",id);
        }

    }
}
